package com.uk.data.entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.vaadin.data.util.BeanItemContainer;

@Entity()
@Table(name="PERDORIMI")
public class Perdorimi implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9029162696833434795L;
	@Id
	private Integer id;
	private String tag;
	
	
	public Perdorimi(Integer id, String tag){
		this.id = id;
		this.tag = tag;
	}
	
	
	public Perdorimi() {
		super();
		// TODO Auto-generated constructor stub
	}


	public static List<Perdorimi> createWithTestData(){
		List<Perdorimi> perdorimet = new ArrayList<Perdorimi>();
		perdorimet.add(new Perdorimi(1, "FAMILJAR"));
		perdorimet.add(new Perdorimi(2, "BIZNES I VOGEL"));
		perdorimet.add(new Perdorimi(3, "BIZNES I MADH"));
		perdorimet.add(new Perdorimi(4, "INSTITUCION SHTETEROR"));
	
		return perdorimet;
		
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTag() {
		return tag;
	}
	public void setTag(String tag) {
		this.tag = tag;
	}




	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((tag == null) ? 0 : tag.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Perdorimi other = (Perdorimi) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (tag == null) {
			if (other.tag != null)
				return false;
		} else if (!tag.equals(other.tag))
			return false;
		return true;
	}


	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Perdorimi [id=");
		builder.append(id);
		builder.append(", tag=");
		builder.append(tag);
		builder.append("]");
		return builder.toString();
	}


	
	
	
}
